package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLByteList;
import HLLib.base.HLCollection;
import HLLib.base.HLIntList;
import HLLib.base.HLList;
import HLLib.base.HLString;
import HLLib.io.HLFile;

public class HLClassCollection extends HLLibClass {
    public HLClassCollection(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLCollection();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLCollection) self).PutInteger((HLString)args.GetObject(0), args.GetInt(0));
            break;
        }
        case 1: {
            ((HLCollection) self).PutString((HLString)args.GetObject(0), (HLString)args.GetObject(1));
            break;
        }
        case 2: {
            ((HLCollection) self).PutByteList((HLString)args.GetObject(0), (HLByteList)args.GetObject(1));
            break;
        }
        case 3: {
            ((HLCollection) self).PutIntList((HLString)args.GetObject(0), (HLIntList)args.GetObject(1));
            break;
        }
        case 4: {
            ((HLCollection) self).PutStringList((HLString)args.GetObject(0), (HLList)args.GetObject(1));
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                ((HLCollection) self).GetInteger((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLCollection) self).GetInteger((HLString)args.GetObject(0)));
            }
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                ((HLCollection) self).GetString((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLCollection) self).GetString((HLString)args.GetObject(0)));
            }
            break;
        }
        case 7: {
            if (resultOwnerObject == null) {
                ((HLCollection) self).GetByteList((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLCollection) self).GetByteList((HLString)args.GetObject(0)));
            }
            break;
        }
        case 8: {
            if (resultOwnerObject == null) {
                ((HLCollection) self).GetIntList((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLCollection) self).GetIntList((HLString)args.GetObject(0)));
            }
            break;
        }
        case 9: {
            if (resultOwnerObject == null) {
                ((HLCollection) self).GetStringList((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLCollection) self).GetStringList((HLString)args.GetObject(0)));
            }
            break;
        }
        case 10: {
            ((HLCollection) self).Clear();
            break;
        }
        case 11: {
            ((HLCollection) self).Remove((HLString)args.GetObject(0));
            break;
        }
        case 12: {
            ((HLCollection) self).ReadFrom((HLFile)args.GetObject(0));
            break;
        }
        case 13: {
            ((HLCollection) self).ReadFromOld((HLFile)args.GetObject(0));
            break;
        }
        case 14: {
            ((HLCollection) self).WriteTo((HLFile)args.GetObject(0));
            break;
        }
        case 15: {
            if (resultOwnerObject == null) {
                ((HLCollection) self).ContainsKey((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLCollection) self).ContainsKey((HLString)args.GetObject(0)));
            }
            break;
        }
        case 16: {
            if (resultOwnerObject == null) {
                ((HLCollection) self).GetKeys();
            } else {
                resultOwnerObject.SetObject(resultIndex, ((HLCollection) self).GetKeys());
            }
            break;
        }
        }
    }
}
